package com.example.androidkt.seventh

import android.os.Bundle
import androidx.fragment.app.Fragment
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.Button
import androidx.navigation.Navigation
import com.example.androidkt.R
import com.example.androidkt.databinding.FragmentMainBinding


class MainFragment : Fragment() {

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

    }

    override fun onCreateView(
        inflater: LayoutInflater, container: ViewGroup?,
        savedInstanceState: Bundle?
    ): View? {
        val view = inflater.inflate(R.layout.fragment_main, container, false)

        view.findViewById<Button>(R.id.btn_to_setting).setOnClickListener {
            val bundle = Bundle()
            bundle.apply {
                putString("xx","xxxx")
            }
            Navigation.findNavController(it).navigate(R.id.settingFragment,bundle)
        }




        return view
    }


}